function user_confirm(txtAlert) {
    if (window.confirm(txtAlert) == true) {
        return true;
    }
    return false;
}

function commafy( num ) {
    var str = num.toString().split('.');
    if (str[0].length >= 5) {
        str[0] = str[0].replace(/(\d)(?=(\d{3})+$)/g, '$1,');
    }
    if (str[1] && str[1].length >= 5) {
        str[1] = str[1].replace(/(\d{3})/g, '$1 ');
    }
    return str.join('.');
}

//AJAX
$(document).ready(function() {    
    $("a.test").click(function() {
         var name = $(this).attr("title");
        $.ajax({
            url: "ajax.php",
            type: "get",
            data: "name=" + name,
            dataType: "html",
            beforeSend: function() {$("#content").html('<img src="images/loading.gif" style="margin: 10px auto; display:block;" />');},
            cache: true
        })
        .done(function(result){
            $("#content").html(result);
        });
        return false;
    });
});


